package com.qkl.xiatang.app.dto.log;

import com.qkl.xiatang.app.dto.PageInDTO;
import com.qkl.xiatang.app.dto.feed.QueryFeedListOut;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.util.List;

/**
 * 工作日志查询 输入
 */
@Data
public class JobLogInDTO extends PageInDTO {

    //logType 1饲料，2 动保 3 卖虾日志 ，4 饲料库存消耗日志， 5 动保库存消耗日志, 6 视频日志
    private static final String LOG_TYPE_FEED = "1";

    private static final String LOG_TYPE_ZOO = "2";

    private static final String LOG_TYPE_SALE = "3";

    private static final String LOG_TYPE_STOCK_FEED = "4";

    private static final String LOG_TYPE_STOCK_ZOO = "5";

    private static final String LOG_TYPE_VIDEO = "6";

    private static final String DESC = "DESC";

    private static final String ASC = "ASC";

    private String companyId;

    private Integer serialNo;

    private String startAllocDate;

    private String endAllocDate;

    private String logType;

    private Integer type;

    private String sign;

    /**
     *  0 顺序，1 倒序，默认为 倒序
     */
    private String sort;

    private String order;

    private List<String> pondIdList;

    private List<QueryFeedListOut> zooFeedList;

    public void orderSort(){
        order = DESC;
        if("0".equals(StringUtils.trimToEmpty(sort))){
            order = ASC;
        }
    }

    public boolean isLogTypeZoo(){
        return LOG_TYPE_ZOO.equals(logType);
    }

    public boolean isLogTypeSale(){
        return LOG_TYPE_SALE.equals(logType);
    }

    public boolean isLogTypeStockFeed(){
        return LOG_TYPE_STOCK_FEED.equals(logType);
    }

    public boolean isLogTypeStockZoo(){
        return LOG_TYPE_STOCK_ZOO.equals(logType);
    }
    public boolean isLogTypeVideo(){
        return LOG_TYPE_VIDEO.equals(logType);
    }

}
